package com.example.demo.service

import com.example.demo.bean.UserBean
import com.example.demo.dao.UserDao
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

@Service("authorService")
open class UserDaoServiceImpl : UserDaoService {

    @Autowired
    private lateinit var userInfoDao : UserDao


    override fun login(username: String, pwd: String): UserBean? {
        return userInfoDao.login(username,pwd)
    }

    override fun register(username: String, pwd: String,phone:String): Boolean? {
        return userInfoDao.register(username, pwd,phone)
    }

    override fun delete(username: String): Boolean? {
        return userInfoDao.delete(username)
    }

    override fun update(phone: String): Boolean? {
        return userInfoDao.update(phone)
    }
//    override fun findUser(id: Long): UserBean? {
//        TODO("Not yet implemented")
//    }

//    override fun update(author: UserBean): Int {
//        return this.loginDao.update(author)
//    }
//
//    override fun add(author: UserBean): Int {
//        return this.loginDao.add(author)
//    }
//
//    override fun delete(id: Long): Int {
//        return this.loginDao.delete(id)
//    }
//
//    override fun findAuthor(id: Long): UserBean? {
//        return this.loginDao.findAuthor(id)
//    }
//
//    override fun findAuthorList(): List<UserBean> {
//        return this.loginDao.findAuthorList()
//    }
}